//
//  UserService.swift
//  RXSwiftDemo
//
//  Created by Apple on 2018/7/24.
//  Copyright © 2018年 LuckyStrike. All rights reserved.
//

import Foundation
import ReactiveSwift
import Result

final class UserService {
    let (requestSignal, requestObserver) = Signal<String, NoError>.pipe()
    
    func canUseUsername(_ string: String) -> SignalProducer<Bool, NoError> {
        return SignalProducer { observer, disposable in
            self.requestObserver.send(value: string)
            observer.send(value: true)
            observer.sendCompleted()
        }
    }
}
